package com.cks.vod.controller;

import com.cks.commonutils.R;
import com.cks.vod.service.VodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/eduVod/vod")
public class VodController {

    @Autowired
    private VodService vodService;
    //上传视频到阿里云
    @PostMapping("/uploadAlyVideo")
    public R uploadAlyVideo(MultipartFile file){
        //返回上传视频的id
        String videoId=vodService.uploadAlyVideo(file);
        System.out.println("我不懂");
         return  R.ok().data("videoId",videoId);
    }
    @GetMapping("/hello")
    public  String hello(){
        return  "hello";
    }

}
